package com.hui.controller;

import com.hui.service.StoreCategoryService;
import com.hui.util.ResponseResult;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * StoreCategory 控制层
 * 商品分类
 */

@RestController
@CrossOrigin
@RequiredArgsConstructor
@RequestMapping("/api")
public class StoreCategoryController {

    private final StoreCategoryService storeCategoryService;

    /**
     * 获取商品分类
     *
     * @return
     */
    @GetMapping("/category")
    public ResponseResult getcategory() {
        return storeCategoryService.getList();
    }
}
